<template>
	<!--父级调用 FlowNodeTmp -->

	<a-button
		v-if="status === 0"
		type="text"
		:disabled="disabled"
	>待审核</a-button>
	<a-button
		v-else-if="status === 1"
		:disabled="disabled"
		type="text"
		style="color:#87d068"
	>通过</a-button>
	<!-- {{ lastStatus }}已退回{{ status }}{{ lastStatus === status }} -->
	<template v-else-if="status === -1">
		<a-button
			:style="lastStatus === status?'color:#f50':''"
			type="text"
			danger
			:disabled="disabled"
		>
			<span>
				退回
			</span>
		</a-button>

	</template>
	<a-button
		v-else-if="status === 2"
		type="text"
		:disabled="disabled"
	>完成</a-button>

</template>
<script setup>
/**
 * 项目进度节点状态按钮
 */
import { ref, onMounted } from "vue";
const flowStatus = ref();
flowStatus.value = [
	{ status: -1, name: "已退回" },
	{ status: 0, name: "待审核" },
	{ status: 1, name: "已通过" },
	{ status: 2, name: "完成" },
];
const getStatusTab = (status) => {
	var data = flowStatus.value.find((e) => {
		if (e.status === status) {
			return e;
		}
	});
	if (data) {
		return data.name;
	}
	return "";
};
const props = defineProps({
	status: {
		type: Number,
		required: true,
		default: -9,
	},
	lastStatus: {
		type: Number,
		required: false,
		default: 0,
	},
	disabled: {
		type: Boolean,
		required: false,
		default: false,
	},
});
</script>